package org.come.control;

import org.come.Frame.PalacePKJframe;
import org.come.Frame.ZhuFrame;
import org.come.action.NpcMenuAction;
import org.come.until.FormsManagement;

import com.tool.image.ImageMixDeal;

public class SurfaceAssemblyControl implements NpcMenuAction {

    @Override
    public void menuControl(String type) {

        if ("我要下挑战书".equals(type)) {// 下挑战书
            // 先判断他的等级可否下挑战书
            int grade = ImageMixDeal.userimg.getRoleShow().getGrade() - 279;
            if (grade < 50) {
                ZhuFrame.getZhuJpanel().addPrompt2("您当前的等级不能下挑战书！！");
                return;
            }
            // 擂主下战书
            PalacePKJframe.getPalacePKJframe().getPkJpanel().changeView(0);
            // 打开下战书面板
            FormsManagement.showForm(66);
        } else if ("我要下战书".equals(type)) {
            // 先判断他的等级可否下挑战书
            int grade = ImageMixDeal.userimg.getRoleShow().getGrade();
            if (grade < 399) {
                ZhuFrame.getZhuJpanel().addPrompt2("您当前的等级不能下战书！！");
                return;
            }
            // 擂主下战书
            PalacePKJframe.getPalacePKJframe().getPkJpanel().changeView(1);
            // 打开下战书面板
            FormsManagement.showForm(66);
        }
    }
}
